#ifndef TBL_HOUSE_DAO_H
#define TBL_HOUSE_DAO_H

#include <QObject>
#include <QSqlDatabase>

class tbl_house_dao : public QObject
{
    Q_OBJECT
public:
    explicit tbl_house_dao(QSqlDatabase& db, QObject *parent = nullptr);
    //
    bool createTable();
    bool insertRow(QString & housename,QString & owner,int & limit,QString & startime,QString & endtime,QString & msg);
    bool selectRows(QVector<QStringList> & table, QString & msg);
    int selectLimit(int houseid, QString & msg);
    bool deleteRow(int & serial, QString & msg);
    bool updateRow(int & seiral, QString & housename,QString & owner,int & limit,QString & startime,QString & endtime,QString & msg);

signals:

private:
    QSqlDatabase& db;
};

#endif // TBL_HOUSE_DAO_H
